def getUser():
    while True:
        userstr = input("请输入字符串(长度:1-255): \n")
        strlen = len(userstr)
        if strlen > 0 and strlen <= 255:
            return userstr
        else:
            print("长度有误\n")

def letter(str):
    strlist = []
    for i in str:
        if (ord(i)>=65 and ord(i)<=90) or (ord(i)>=97 and ord(i) <=122):
            strlist.append(i)
    strlist2 = []
    for j in range(0,len(strlist)):
        strlist2.append(strlist[len(strlist)-j-1])
    return strlist2

def kaisa(str,num=3):
    result = []
    for s in str:
        if (ord(s)>=65 and ord(s)<=90):
           result.append( chr((ord(s)-65+num)%26+65))
        elif (ord(s)>=97 and ord(s) <=122):
            result.append( chr((ord(s)-97+num)%26+97))
    sumstr = ''
    for i in result:
        sumstr+=i
    print(sumstr)
    return sumstr

kaisa(letter(getUser()))